﻿<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<script src="http://cdn.static.runoob.com/libs/angular.js/1.4.6/angular.min.js"></script>
		
	</head>
	<body>
		<div ng-app="myApp" ng-controller="myCtrl"> 

			<p>两秒后显示信息:</p>

			<h1>{{myHeader}}</h1>

		</div>

			<p>$timeout 访问在规定的毫秒数后执行指定函数。</p>

		<script>
			var app = angular.module('myApp', []);
			app.controller('myCtrl', function($scope, $timeout) {
			  $scope.myHeader = "Hello World!";
			  $timeout(function () {
				  $scope.myHeader = "How are you today?";
			  }, 2000);
			});
		</script>
	</body>
</html>
